import service from "../service.js";
import qs from "qs"
import { IUserData } from "../types.d";

export function login (data:IUserData){
    return service({
        method:'post',
        url:'/login',
        data

    })
}
export function students(params:any){
    return service({
        method:'get',
        url:'/students',
        params
    })
}
export function studentDel(id:any){
    return service({
        method:'delete',
        url:`/students/${id}`
    })
}
// export function info(data){
//     data = qs.stringify(data)   
//     return service({
//         method:'post',
//         url:'/info',
//         data
//     })    
// }
// export function updateInfo(data){
//     data = qs.stringify(data)   
//     return service({
//         method:'put',
//         url:'/info',
//         data
//     })    
// }
export function Info(type:any,data:any){
        data = qs.stringify(data)   
        let obj ={method:type,url:'/info',data}
        return service(obj)    
    }
export function getInfo(){   
    return service({
        method:'get',
        url:'/info'
    })    
}
export function infoDel(id:any){
    return service({
        method:'delete',
        url:`/info/${id}`
    })
}
export function dataview(){
    return service({
        method:'get',
        url:'/dataview'
    })
}
export function travel(){
    return service({
        method:'get',
        url:'travel'
    })
}